package array_2D;


import java.util.Scanner;
import java.util.Random;

public class JoyBetweenRoommate {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Random r = new Random();
        int row, col, num;
        int[][] arr = new int[5][5];
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                arr[i][j] = r.nextInt(9) + 1;
            }
        }
        System.out.print("请输入你选定的行:>");
        row = sc.nextInt();
        System.out.print("请输入你选定的列:>");
        col = sc.nextInt();
        System.out.print("请输入你猜测的数字(1~10,输入错误视为放弃资格):>");
        num = sc.nextInt();
        if(arr[row][col] == num)
            System.out.println("恭喜你猜对了-。-");
        else
            System.out.println("猜错啦！");
    }

}
